<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>组合线管理</title>
<%-- 全站样式 --%>
<jsp:include page="/WEB-INF/jsps/template_style.jsp"></jsp:include>

<!--算法文件css-->
<link rel="stylesheet" href="../assets/css/folder/file.css">

<!--Datatables所需要的js和css文件-->
<script type="text/javascript" src="assets/css/dataTables.bootstrap.css"></script>
<script type="text/javascript" src="assets/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="assets/js/dataTables.bootstrap.js"></script>
<!--右击菜单js-->
<script type="text/javascript" src="assets/js/BootstrapMenu.min.js"></script>

</head>

<body>
	<div class="page-container">
		<%--侧边栏 --%>
		<jsp:include page="/WEB-INF/jsps/sidebar.jsp"></jsp:include>

		<div class="main-content">
			<%--导航栏 --%>
			<jsp:include page="/WEB-INF/jsps/navbar.jsp"></jsp:include>
			<section class="gallery-env">
			<div class="row">
				<!-- Gallery Album Optipns and Images -->
				<div class="col-sm-12 ">
					<!-- Album Header -->
					<div class="album-header">
						<div class="row">
							<div class="col-sm-12">
								<h2>组合线</h2>
								<ul class="album-options list-unstyled list-inline">
									<li>
										<button type="button"
											class="btn btn-default buttonself1 upload1">
											<i class="fa-plus fontstyle"></i>添加
										</button>
									</li>
									<li>
										<button type="button"
											class="btn btn-default buttonself1 delete1" onclick="deleteCheck()">
											<i class="fa-trash fontstyle"></i>删除
										</button>
									</li>
								</ul>
							</div>
						</div>
					</div>
					<script type="text/javascript">
						$(document).ready(function(){
							$(document).on("click", ".upload1", function(){
								
								$.ajax({
					    		       url:"/getConnectionAlgorithmInfo.do",
					    		       type:"POST",
					    		       dataType:"json",
					    		       success: function(data){
					    		    	   $(".Hardware").html("");
					    		    	   $(".PretreatmentAlgorithm").html("");
					    		    	   $(".AnalysisAlgorithm").html("");
					    		    	   $(".Detected").html("");  
					    		    	   $(".standard").html(""); 
					    		    	   $(".Detecte1").html("");
					    		    	   
					    		     	   $.each(data.datasHardware,function(n,value){
					    		     			$(".Hardware").append("<option value='"+value.hardwareID+"'>"+value.hardwareName+"</option>");
	                      	    		   });
					    		     	   $.each(data.datasAlgorithm,function(n,value){
					    		     			if(value.algorithmSort == 0){
					    		     				$(".PretreatmentAlgorithm").append("<option value='"+value.id+"'>"+value.algorithmName+"</option>");
					    		     			}else{
					    		     				$(".AnalysisAlgorithm").append("<option value='"+value.id+"'>"+value.algorithmName+"</option>");
					    		     			}
					    		     	   });
					    		     	   $.each(data.datasDetecteD,function(n,value){
					    		     			$(".Detected").append("<option value='"+value.detectedID+"'>"+value.detectedName+"</option>");
					    		     	   });
					    		     	  $.each(data.datasStandard,function(n,value){
					    		     			$(".standard").append("<option value='"+value.id+"'>"+value.standardName+"</option>");
					    		     	   });
					    		     	 $.each(data.datasDetecte,function(n,value){
					    		     			$(".Detecte1").append("<option value='"+value.contentID+"'>"+value.name+"</option>");
					    		     	   });	    		     	  
					    		       },
					    		       error: function(XMLHttpRequest, textStatus, errorThrown) {
					    				   alert(XMLHttpRequest.status);
					    				   alert(XMLHttpRequest.readyState);
					    				   alert(textStatus);
					    				   },
					    			}); 
								$('#uploadmodal').modal('show');
							});	
							
							$(document).on("click",".add2",function(){
								$('#add2').modal("show");
							});
							
				            $("#right").click(function(){
				                $("#k2").append($("#k1 option:selected"));
				            });

				            $("#left").click(function(){
				                $("#k1").append($("#k2 option:selected"));
				            });

				            $("#allright").click(function(){
				                $("#k2").append($("#k1 option"));
				            });

				            $("#allleft").click(function(){
				                $("#k1").append($("#k2 option"));
				            });
				            var Detected_Detectes =  new Array();
				            
				            function Detected_Detecte(Detected,Detecte) {
				                this.Detected = Detected;
				                this.Detecte = Detecte;
				            }
				            
				            $(document).on("click", ".addConnectionAlgorithm", function(){
				            	
				            	console.log(Detected_Detectes);
				            	var hardwareID = $("#uploadmodal .Hardware").find("option:selected").val()
				            	var PretreatmentAlgorithmID =  $("#uploadmodal .PretreatmentAlgorithm").find("option:selected").val();
				            	var analysisAlgorithmID =  $("#uploadmodal .AnalysisAlgorithm").find("option:selected").val()
				            	var standardID = $("#uploadmodal .standard").find("option:selected").val()
				            	var connectionAlgorithmName = $(".Name").val();
				            	var connectionAlgorithmDescribe = $(".connectionAlgorithmDescribe").val();
				            	if(Detected_Detectes.length == 0){
				            		alert("请添加完整数据！");
				            	}else{
				            	$.ajax({
					    		       url:"/addConnectionAlgorithm.do",
					    		       type:"POST",
					    		       dataType:"json",
					    		       data:{
					    		    	   'hardwareID': hardwareID,
					    		    	   'connectionAlgorithmName' : connectionAlgorithmName,
					    		    	   'analysisAlgorithmID' : analysisAlgorithmID,
					    		    	   'PretreatmentAlgorithmID' : PretreatmentAlgorithmID,
					    		    	   'standardID' : standardID,
					    		    	   'connectionAlgorithmDescribe' : connectionAlgorithmDescribe,
					    		    	   'Detected_Detectes' : Detected_Detectes,
					    		    	   'Detected_DetectesLength' : Detected_Detectes.length
					    		       },
					    		       success: function(data){
					    		    	 $('#uploadmodal').modal('hide');
					    		     	 $(location).attr('href', 'displayConnection.do');
					    		       },
					    		       error: function(XMLHttpRequest, textStatus, errorThrown) {
					    				   alert(XMLHttpRequest.status);
					    				   alert(XMLHttpRequest.readyState);
					    				   alert(textStatus);
					    				   },
					    			});
				            	}
				            });
				            $(document).on("click", ".addDetected_Detecte", function(){
				            	
				            	var Detected = $(".Detected").val();
				            	var Detecte = new Array(); 
				            	 $(".Detecte2 option").each(function(){  //遍历所有option 
				            		
				                     var txt = $(this).val();   //获取option值   
				                     if(txt!=''){  
				                    	 Detecte.push(txt);  //添加到数组中  
				                     }  
				                });
				            	 var obj = new Detected_Detecte(Detected,Detecte);
				            	 Detected_Detectes.push(obj);
				            	 $("#k1").append($("#k2 option"));
				            });
				            
						})
					</script>
					<script type="text/javascript">
	function deleteCheck() {
		var flag;
		
        $("input[name='checkbox']:checked").each(function() { // 遍历选中的checkbox
        	n = $(this).parents("tr").index()+1;  // 获取checkbox所在行的顺序
        	
        	console.log(n);
			var id=$("table#example").find("tr:eq("+n+")").attr("data-favoriteID");
			$.ajax({
				url : "/deleteConnection.do",
				type : "POST",
				dataType : "json",
				data : {'id' : id},
				success : function(data) {
					flag=data.result;
					
				},
				error : function(XMLHttpRequest,textStatus,errorThrown) {
					alert("删除失败");
				},
		 	});
			if(n!=1&&flag=="success"){
				$("table#example").find("tr:eq("+n+")").remove();
			}
        	
		});
	}
	
	</script>
					<!-- DataTables -->
					<section class="mailbox-env">
					<div class="mail-env">
						<div width="98%" style="margin-left: 10px;">
							<!--第二步：添加如下 HTML 代码-->
							<table id="example" class="table table-striped table-bordered"
								style="width: 98%;" cellspacing="0">
								<thead>
									<tr>
										<th class="no-sorting">全选<input type="checkbox" class="a"
											name="checkbox" id="btn1">
										</th>
										<th>组合线名称</th>
										<th>光谱类型</th>
										<th>检测内容</th>
										<th>被检测物</th>
										<th>标准</th>
										<th>保存时间</th>
										<th>状态</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${datas }" var="data">
										<tr class="tabletr" data-favoriteID="${data['id'] }">
											<td><input type="checkbox" name="checkbox"></td>
											<td>${data['connectionAlgorithmName'] }</td>
											<td>${data['hardware']['spectrumType'] }</td>
											<td><c:forEach items="${data['content'] }" var="c">
												${c['name'] }&nbsp;
											</c:forEach></td>
											<td>${data['detected']['detectedName'] }</td>
											<td>${data['standardName'] }</td>
											<td>${data['connectionAlgorithmSaveTime'] }</td>
											<td id="state">${data['connectionAlgorithmState'] }</td>
										</tr>
									</c:forEach>
									
								</tbody>
							</table>
						</div>
						<script type="text/javascript">
						<!--第三步初始化Datatables-->
							$(document).ready(function() {
								$("#example").DataTable({
															"language" : {
																"url" : "../assets/js/dataTable.zh_CN.json",
															},
															"bPaginage" : true
														});
								$("#btn1").on('click',function() {
													if ($(":checkbox").prop("checked")) {
														$(":checkbox").prop("checked",true);
													} else {
														$(":checkbox").prop("checked",false);
													}
												});

								<!--右击菜单开始-->
								/*文件操作*/
								var menufile1 = new BootstrapMenu('.tabletr',{//初始化插件
											//fetchElementData获取元数据
											fetchElementData : function($rowElem) {
												var data = $rowElem;
												return data; //return的目的是给下面的onClick传递参数
											},

											/*BootstrapMenu的构造函数第一个参数接收一个字符串格式的元素选择器，第二个参数是一个options参数对象。
											 options对象必须至少有一个actions数组，数组中包含右键菜单的action。*/
											actions : [{
														name : '测试',
														onClick : function() {
															$('#look').modal({keyboard : false})
														}
													},{
														name : '查看',
														onClick : function(obj) {
															var id = obj.attr("data-favoriteID");
															$.ajax({
												    		       url:"/getConnectionAlgorithmInfo.do",
												    		       type:"POST",
												    		       dataType:"json",
												    		       success: function(data){
												    		    	   $(".Hardware").html("");
												    		    	   $(".PretreatmentAlgorithm").html("");
												    		    	   $(".AnalysisAlgorithm").html("");
												    		    	   $(".Detected").html("");  
												    		    	   $(".standard").html(""); 
												    		    	   $(".Detecte1").html("");
												    		    	   
												    		     	   $.each(data.datasHardware,function(n,value){
												    		     			$(".Hardware").append("<option value='"+value.hardwareID+"'>"+value.hardwareName+"</option>");
								                      	    		   });
												    		     	   $.each(data.datasAlgorithm,function(n,value){
												    		     			if(value.algorithmSort == 0){
												    		     				$(".PretreatmentAlgorithm").append("<option value='"+value.id+"'>"+value.algorithmName+"</option>");
												    		     			}else{
												    		     				$(".AnalysisAlgorithm").append("<option value='"+value.id+"'>"+value.algorithmName+"</option>");
												    		     			}
												    		     	   });
												    		     	   $.each(data.datasDetecteD,function(n,value){
												    		     			$(".Detected").append("<option value='"+value.detectedID+"'>"+value.detectedName+"</option>");
												    		     	   });
												    		     	  $.each(data.datasStandard,function(n,value){
												    		     			$(".standard").append("<option value='"+value.id+"'>"+value.standardName+"</option>");
												    		     	   });
												    		     	 $.each(data.datasDetecte,function(n,value){
												    		     			$(".Detecte1").append("<option value='"+value.contentID+"'>"+value.name+"</option>");
												    		     	   });	    		     	  
												    		       },
												    		       error: function(XMLHttpRequest, textStatus, errorThrown) {
												    				   alert(XMLHttpRequest.status);
												    				   alert(XMLHttpRequest.readyState);
												    				   alert(textStatus);
												    				   },
												    			}); 
														$.ajax({
											    		       url:"/getConnectionAlgorithmByID.do",
											    		       type:"POST",
											    		       dataType:"json",
											    		       data:{
											    		    	   'id': id
											    		       },
											    		       success: function(data){
											    		    	   $(".connectionAlgorithmID").val(data.datasConnectionAlgorithm[0].connectionAlgorithmID);
											    		    	   $(".connectionAlgorithmName").val(data.datasConnectionAlgorithm[0].connectionAlgorithmName);
											    		    	   $(".connectionAlgorithmSaveTime").val(data.datasConnectionAlgorithm[0].connectionAlgorithmSaveTime);
											    		    	   $(".connectionAlgorithmDescribe").val(data.datasConnectionAlgorithm[0].connectionAlgorithmDescribe);
											    		    	   $(".connectionAlgorithmState").val(data.datasConnectionAlgorithm[0].connectionAlgorithmState);
											    		    	   $(".id").val(data.datasConnectionAlgorithm[0].id);
											    		    	   
											    		    	   $(".standard").find("option[value = '"+data.datasConnectionAlgorithm[0].standardID+"']").attr("selected","selected");
											    		    	   $(".Hardware").find("option[value = '"+data.datasConnectionAlgorithm[0].hardwareID+"']").attr("selected","selected");
											    		    	   $(".PretreatmentAlgorithm").find("option[value = '"+data.datasConnectionAlgorithm[0].PretreatmentAlgorithmID+"']").attr("selected","selected");
											    		    	   $(".AnalysisAlgorithm").find("option[value = '"+data.datasConnectionAlgorithm[0].analysisAlgorithmID+"']").attr("selected","selected");
											    		    	  
											    		    	   $(".detected").val("");
											    		    	   var datasDetectedNames=new Array();;
											    		    	   $.each(data.datasDetected,function(n,value){
											    		    		   datasDetectedNames.push(value.detectedName);
											    		     	   });
											    		    	   $(".detected").val(datasDetectedNames.join(", "));
											    		    	   $(".detecte").val("");
											    		    	   var datasDetecteNames=new Array();;
											    		    	   $.each(data.datasDetecte,function(n,value){
											    		    		   datasDetecteNames.push(value.name);
											    		     	   });
										    		     			$(".detecte").val(datasDetecteNames.join(", "));
											    		    	   
											    		    	   console.log(data);
											    		    	   $('#look').modal({keyboard : false});
											    		    	  
											    		       },
											    		       error: function(XMLHttpRequest, textStatus, errorThrown) {
											    				   alert(XMLHttpRequest.status);
											    				   alert(XMLHttpRequest.readyState);
											    				   alert(textStatus);
											    				   },
											    			});
														
														$(document).on("click","select option", function(){
															$(this).parent().find("option[value = '2']").attr("selected", false);
															$(this).parent().find("option[value = '"+$(this).val()+"']").attr("selected","selected");
														});
														$(document).on("click",".update2", function(){
															
															$.ajax({
												    		       url:"/updateConnectionAlgorithm.do",
												    		       type:"POST",
												    		       dataType:"json",
												    		       data:{
												    		    	   'id': $(".id").val(),
												    		    	   'connectionAlgorithmName': $("#look .connectionAlgorithmName").val(),
												    		    	   'Hardware':$("#look .Hardware").find("option:selected").val(),
												    		    	   'PretreatmentAlgorithm':$("#look .PretreatmentAlgorithm").find("option:selected").val(),
												    		    	   'AnalysisAlgorithm':$("#look .AnalysisAlgorithm").find("option:selected").val(),
												    		    	   'standard':$("#look .standard").find("option:selected").val(),
												    		    	   'connectionAlgorithmDescribe':$("#look .connectionAlgorithmDescribe").val()
												    		       },
												    		       success: function(data){
												    		    	   $('#look').modal('hide');
													    		       $(location).attr('href', 'displayConnection.do');
												    		    	  
												    		       },
												    		       error: function(XMLHttpRequest, textStatus, errorThrown) {
												    				   alert(XMLHttpRequest.status);
												    				   alert(XMLHttpRequest.readyState);
												    				   alert(textStatus);
												    				   },
												    			});
														});
														}
													},{
														name : '公开',
														onClick : function(obj) {
														var id = obj.attr("data-favoriteID");
														$.ajax({
																url : "/openConnection.do",
																type : "POST",
																dataType : "json",
																data : {'id' : id},
																success : function(data) {
																		$(obj.children("td")[7]).text("待审核");
																},
																error : function(XMLHttpRequest,textStatus,errorThrown) {
																	alert("公开失败");
																},
																});
														}
													},{
														name : '删除',
														onClick : function(obj) {
														var id = obj.attr("data-favoriteID");
														$.ajax({
																url : "/deleteConnection.do",
																type : "POST",
																dataType : "json",
																data : {'id' : id},
																success : function(data) {
																	obj.remove();
																},
																error : function(XMLHttpRequest,textStatus,errorThrown) {
																	alert("删除失败");
																},
																});
														}
													}]
										});
								<!--右击菜单结束-->

								/*删除文件*/
								$(document).on("click",".delete1",function() {
										$('table :checkbox').each(function() {
											var isChecked = $(this).prop('checked'); // $(this) 获取当前的循环对象，此例中表示 table 中的 checkbox 子元素 集合中的一个元素
											if (isChecked) {
												$(this).parent().parent(".tabletr").remove();
											}
										});
								});
							});
						</script>


					</div>
					</section>
				</div>

			</div>
			</section>

			<%--页脚 --%>
			<jsp:include page="/WEB-INF/jsps/footer.jsp"></jsp:include>
		</div>
	</div>


	<!-- 模态框（Modal） -->
	<!--添加组合线开始-->
	<div class="modal fade" id="uploadmodal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">添加组合线</h4>
				</div>
				<div class="modal-body">
					<div class="panel panel-default">
						<div class="panel-body">
							<form role="form" class="form-horizontal" method="post"
								enctype="multipart/form-data">
								<div class="form-group">
									<label class="col-sm-3 control-label" >检验线名称
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										 <input type="text" class="form-control Name" name="Name"   maxlength="16" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="Hardware">硬件类型
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<select class="form-control Hardware" name="Hardware" required>

											
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">预处理算法 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control PretreatmentAlgorithm" name="PretreatmentAlgorithm" required>

										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">分析算法 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control AnalysisAlgorithm" name="AnalysisAlgorithm" required>
											<div class="col-sm-9">
												
											</div>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">被检测物-检测内容 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<input class="btn btn-primary add2" type="button" value="添加">
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-3 control-label">标准<font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control standard" name="standard" required>

										</select>	
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="description">检验线描述
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<textarea class="form-control autogrow connectionAlgorithmDescribe" cols="5"
											name="plugin.description" placeholder="检验线描述..."
											maxlength="200" required></textarea>
									</div>
								</div>
								<div class="form-group-separator"></div>
								<div class="form-group col-sm-6 pull-right">
									<button type="button" class="btn btn-default"
										data-dismiss="modal">关闭</button>
									<button type="button" class="btn btn-primary addConnectionAlgorithm">保存</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--添加组合线结束-->
	
	<!--添加检测内容开始-->
	<div class="modal fade" id="add2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document" style="width: 680px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">添加检测内容</h4>
				</div>
				<div class="modal-body">
					<div class="panel panel-default">
						<div class="panel-body">
							<form role="form" class="form-horizontal" method="post" enctype="multipart/form-data">
								<div class="form-group">
									<label class="col-sm-2 control-label" >被检测物 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control Detected" name="Detected" required>

										</select>
									</div>
								</div>
								<div class="row" role="form">
									<div class="form-group col-sm-4" >
							              <select multiple class="form-control Detecte1" id="k1" style="width:200px; height:360px;">

							              </select>
									</div>
									<div class="form-group col-sm-4">
										<div style="margin-left:54px;">
										 	<input type="button" id="right" value=">>"/>
							                <input type="button" id="allright" value="==>>"/><br/>
							                <input type="button" id="left" value="<<"/>
							                <input type="button" id="allleft" value="<<=="/>
							            </div>
									</div>
									<div class="form-group col-sm-4" >
										<select multiple class="form-control Detecte2" id="k2" style="width:200px; height:360px;">

						             	 </select>
									</div>
									<div class="form-group col-sm-4" >
							              <button type="button" class="btn btn-primary addDetected_Detecte">添加</button>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								<div class="form-group col-sm-2 pull-right">
									<button type="button" class="btn btn-primary"
										data-dismiss="modal">关闭</button>
									
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--添加检测内容结束-->
	
	<!--查看算法开始-->
	<div class="modal fade" id="look" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">查看组合线</h4>
				</div>
				<div class="modal-body">
					<div class="panel panel-default">
						<div class="panel-body">
							<form action="plugin/uploadPlugin" role="form" class="form-horizontal" method="post"
								enctype="multipart/form-data">
								<div class="form-group" style="display:none;">
									<label class="col-sm-3 control-label" for="connectionAlgorithmID">id
										<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control id"
											name="id" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="connectionAlgorithmID">组合线编号
										<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control connectionAlgorithmID"
											name="connectionAlgorithmID" readonly="readonly" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="connectionAlgorithmName">组合线名字
										<font color="red">*</font>
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control connectionAlgorithmName"
											name="connectionAlgorithmName"
											placeholder="组合线名字..." maxlength="16" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="Hardware">硬件类型
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<select class="form-control Hardware" name="Hardware" required>

											
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">预处理算法 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control PretreatmentAlgorithm" name="PretreatmentAlgorithm" required>

										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">分析算法 <font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control AnalysisAlgorithm" name="AnalysisAlgorithm" required>
											<div class="col-sm-9">
												
											</div>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">标准<font
										color="red">*</font></label>
									<div class="col-sm-9">
										<select class="form-control standard" name="standard" >

										</select>	
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">保存时间<font
										color="red">*</font></label>
									<div class="col-sm-6">
										<input type="text" class="form-control connectionAlgorithmSaveTime"
											name="connectionAlgorithmSaveTime" readonly="readonly" maxlength="16" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">状态 <font
										color="red">*</font></label>
									<div class="col-sm-6">
										<input type="text" class="form-control connectionAlgorithmState"
											name="connectionAlgorithmState" readonly="readonly"
											maxlength="16" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="detected">被检测物
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<textarea class="form-control autogrow detected" readonly="readonly" cols="5"
											name="detected" maxlength="200" required></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label " for=detecte>检测内容
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<textarea class="form-control autogrow detecte" readonly="readonly" cols="5"
											name="detected" maxlength="200" required></textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label" for="description">检验线描述
										<font color="red">*</font>
									</label>
									<div class="col-sm-9">
										<textarea class="form-control autogrow connectionAlgorithmDescribe" cols="5"
											name="plugin.description" placeholder="检验线描述..."
											maxlength="200" required></textarea>
									</div>
								</div>
								<div class="form-group-separator"></div>
								<div class="form-group col-sm-6 pull-right">
									<button type="button" class="btn btn-default"
										data-dismiss="modal">关闭</button>
									<button type="button" class="btn btn-primary update2">修改</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--查看算法结束-->




	<%-- 尾部内容 --%>
	<jsp:include page="/WEB-INF/jsps/template_tail.jsp" />

	<!-- Imported scripts on this page -->
	<script src="assets/js/jquery-ui.min.js"></script>
	<!--Specific JS for this page-->
	<script type="text/javascript">
		//强行修改bootrap样式，使页面可以弹出两个模态框
		$(document).on('show.bs.modal', '.modal', function(event) {
					        $(this).appendTo($('body'));
					    }).on('shown.bs.modal', '.modal.in', function(event) {
					        setModalsAndBackdropsOrder();
					    }).on('hidden.bs.modal', '.modal', function(event) {
					        setModalsAndBackdropsOrder();
					    });

					    function setModalsAndBackdropsOrder() {  
					        var modalZIndex = 1040;
					        $('.modal.in').each(function(index) {
					            var $modal = $(this);
					            modalZIndex++;
					            $modal.css('zIndex', modalZIndex);
					            $modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
					        });
					        $('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
					    }
	
		// Sample Javascript code for this page
		jQuery(document).ready(
				function($) {
					// Sample Select all images
					$("#select-all").on('change',function(ev) {
								var is_checked = $(this).is(':checked');
								$(".mail-table tbody input[type='checkbox']").prop('checked', is_checked).trigger('change');
							});
					// Edit Modal
					$('.gallery-env a[data-action="edit"]').on('click',function(ev) {ev.preventDefault();
								$("#gallery-image-modal").modal('show');
							});
					// Delete Modal-1
					$('.gallery-env a[data-action="trash"]').on('click',function(ev) {ev.preventDefault();
								$("#gallery-image-delete-modal").modal('show');
							});
					//Delete Modal-2
					$('.gallery-env a[data-action="trash-2"]').on('click',
							function(ev) {
								ev.preventDefault();
								$("#gallery-image-delete-modal-2").modal('show');
							});

				});
	</script>
</body>

</html>